#include "stm32f10x_commonheadfile.h"
int main()
{

	OLED_Init();
	Key_Init();
	Encoder_Init();
	Motor_Init();
	Timer_Init();
	while (True)
	{

		OLED_Show_Data();
		OLED_Update();

	}
}
uint8_t pit_10ms = 0;
//1ms中断轮询一次
void TIM2_IRQHandler(void)
{
	//屏显不要放中断！！！会让中断卡死！！！！
	if (TIM_GetITStatus(TIM2, TIM_IT_Update) == SET)
	{
		Key_control();

		pit_10ms++;
		if (pit_10ms == 10)
		{
			Motor_control();
			pit_10ms = 0;
		}
		TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
	}
}
